﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sigavat.Entities;
using Sigavat.Repository.Mapping;

namespace Sigavat.Repository
{
    public class SigavatContext:DbContext
    {
        static SigavatContext()
        {
            Database.SetInitializer<SigavatContext>(
                new CreateDatabaseIfNotExists<SigavatContext>()
            );
        }

        public DbSet<Promotor> Promotores { get; set; }
        
        public DbSet<CentroComercial> CentroComerciales { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new PromotorMap());
            modelBuilder.Configurations.Add(new CentroComercialMap());
            

        }
    }
}
